//
//  PictureView.m
//  EconomyDemo
//
//  Created by qianfeng01 on 15/7/12.
//  Copyright (c) 2015年 xiangmu. All rights reserved.
//

#import "PictureView.h"
#import "UIImageView+WebCache.h"

#define kScreenSize [UIScreen mainScreen].bounds.size

@implementation PictureView

-(void)setImageNames:(NSMutableArray *)imageNames{
    for (int i=0; i<imageNames.count; i++) {
        self.imageView=[[UIImageView alloc] initWithFrame:CGRectMake(i*kScreenSize.width, 0, kScreenSize.width, 200)];
        [self.imageView sd_setImageWithURL:[NSURL URLWithString:imageNames[i]] placeholderImage:[UIImage imageNamed:@"zhanweitu656_382"]];
        [self addSubview:self.imageView];
    }
    self.pagingEnabled=YES;
    self.contentSize=CGSizeMake(kScreenSize.width*imageNames.count, 200);
}
-(void)setScrollNames:(NSMutableArray *)scrollNames{
    for (int i=0; i<scrollNames.count; i++) {
        UILabel *label=[[UILabel alloc] initWithFrame:CGRectMake(i*kScreenSize.width, 200,kScreenSize.width, 50)];
        NSString *text=[NSString stringWithFormat:@"%d/%ld %@",i+1,(unsigned long)scrollNames.count,self.title];
        label.backgroundColor=[UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:0.1];
        label.textAlignment=NSTextAlignmentLeft;
        label.font=[UIFont boldSystemFontOfSize:15.0];
        label.textColor=[UIColor whiteColor];
        label.text=text;
        label.numberOfLines=0;
        [self addSubview:label];
        UITextView *TextView=[[UITextView alloc] initWithFrame:CGRectMake(i*kScreenSize.width, 250, kScreenSize.width, 130)];
        TextView.backgroundColor=[UIColor blackColor];
        TextView.text=scrollNames[i];
        TextView.textColor=[UIColor whiteColor];
        TextView.editable=NO;
        [self addSubview:TextView];
        
    }
}


@end
